package bma.common.netty.webserver.common;

import org.jboss.netty.channel.Channel;
import org.jboss.netty.handler.codec.http.HttpRequest;

import bma.common.langutil.log.acclog.AccessLog;
import bma.common.netty.webserver.RequestContext;
import bma.common.netty.webserver.RequestDispatcher;

public class RequestContextCommon implements RequestContext {

	protected String path;
	protected Channel channel;
	protected HttpRequest request;
	protected AccessLog accessLog;
	protected RequestDispatcher rootDispatcher;

	public RequestContextCommon(RequestDispatcher dis, Channel channel,
			HttpRequest request, String path, AccessLog accessLog) {
		super();
		this.rootDispatcher = dis;
		this.path = path;
		this.channel = channel;
		this.request = request;
		this.accessLog = accessLog;
	}

	@Override
	public RequestDispatcher getRootDispatcher() {
		return rootDispatcher;
	}

	public void setRootDispatcher(RequestDispatcher rootDispatcher) {
		this.rootDispatcher = rootDispatcher;
	}

	@Override
	public String getPath() {
		return path;
	}

	@Override
	public void setPath(String path) {
		this.path = path;
	}

	@Override
	public Channel getChannel() {
		return channel;
	}

	public void setChannel(Channel channel) {
		this.channel = channel;
	}

	@Override
	public HttpRequest getRequest() {
		return request;
	}

	public void setRequest(HttpRequest request) {
		this.request = request;
	}

	@Override
	public AccessLog getAccessLog() {
		return accessLog;
	}

	public void setAccessLog(AccessLog accessLog) {
		this.accessLog = accessLog;
	}

}
